import { invoke } from '@tauri-apps/api/core';

export interface IAppConfig {
  localHotkey?: string;
  remoteHotkey?: string;
  saveTypeList?: string[];
  savePath?: string;
  remoteAddress?: string;
  localScreenTarget?: 'primary' | 'all';
  autoCreateSavePath?: boolean;
  imgSaveType?: 'jpg' | 'png';
}

export function getConfig() {
  return invoke<IAppConfig>('get_config');
}

export function setConfig(config: IAppConfig) {
  return invoke('set_config', { appConfig: config });
}